class Solution {
public:
    int winningPlayerCount(int n, vector<vector<int>>& pick) {
        unordered_map<int, vector<int>> hash;
        // unordered_set<int> ret;
        int ret = 0;
        vector<bool> won(n, false);
        for(auto &cp : pick)
        {
            int i = cp[0], j = cp[1];
            if(!hash.count(i))
                hash[i].resize(11, 0);
            if(++hash[i][j] > i && won[i] != true)
            {
                won[i] = true;
                ret++;
            }
                // ret.insert(i);
        }
        // return ret.size();
        return ret;
    }
};